#ifndef _UNIT_TEST_UTIL_H
#define _UNIT_TEST_UTIL_H


class LocaleOverrider
{
public:
#ifdef _WIN32
    LocaleOverrider(char* pszLocale, int nCodePage);
#else
    LocaleOverrider(char* pszLocale);
#endif

    ~LocaleOverrider();

private:
    std::string m_oldLocale;
#ifdef _WIN32
    int m_nOldPageCode;
#endif

    // Make it non-copyable
    LocaleOverrider(LocaleOverrider&);
    LocaleOverrider& operator=(LocaleOverrider&);
};

class UnitTestUtil
{
public:
    static bool PointsEqual(FdoIPoint * point1, FdoIPoint * point2);
    static bool PointsEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);
    static bool MultiPointsEqual(FdoIMultiPoint * point1, FdoIMultiPoint * point2);
    static bool MultiPointsEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);
    static bool LineEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);
    static bool PolygonEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);
    static bool MultiLineStringEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);
    static bool MultiPolygonEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);
    static bool MultiGeometryEqual(FdoIGeometry * geom1, FdoIGeometry * geom2);

    static bool PointsEquivalent(FdoIDirectPosition * point1, FdoIDirectPosition * point2);
    static bool LinearRingsEquivalent (FdoILinearRing* lr1, FdoILinearRing* lr2);

    static bool FuzzyEqual (const double d1, const double d2);
};

#endif
